import request from "@/axios/request";
import url from "@/axios/url";
const { wmsUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${wmsUrl}wmsReceiveNoticeOrder/export`;
// 分页查询
export function getList(params = {}) {
  return request({
    url: `${wmsUrl}wmsReceiveNoticeOrder`,
    method: "get",
    params,
  });
}
// 新增
export function rowCreate(data = {}) {
  return request({
    url: `${wmsUrl}wmsReceiveNoticeOrder`,
    method: "post",
    data,
  });
}

// 批量新增
export function rowBatchCreate(data = []) {
  return request({
    url: `${wmsUrl}wmsReceiveNoticeOrder/batch`,
    method: "post",
    data,
  });
}

// 获取仓库信息
export function getCurrentWarehouseCode() {
  return request({
    url: `${wmsUrl}basic`,
    method: "get",
  });
}
// 修改
export function rowUpdate(data = {}) {
  return request({
    url: `${wmsUrl}wmsReceiveNoticeOrder`,
    method: "put",
    data,
  });
}
// 删除
export function rowDel(id) {
  return request({
    url: `${wmsUrl}wmsReceiveNoticeOrder/${id}`,
    method: "put",
  });
}
// 详情
export function rowDetail(id = "", flag = true) {
  return request({
    url: `${wmsUrl}wmsReceiveNoticeOrder/info/${id}/${flag}`,
    method: "get",
  });
}

// 导入用户
export function importData(data = {}) {
  return request({
    url: `${wmsUrl}wmsReceiveNoticeOrder/import`,
    method: "POST",
    data,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}
// 下载模板
export const downloadTemplateUrl = `${wmsUrl}wmsReceiveNoticeOrder/template`;

// 查询仓库编码列表
export function getWarehouseCodeList() {
  return request({
    url: `${wmsUrl}basic`,
    method: "get",
  });
}
// 查询订单状态列表
export function getOrderStatusList() {
  return request({
    url: `${adminUrl}dict/type/wms_receive_order_status`,
    method: "get",
  });
}
// 查询质检进度列表
export function getQualityAssignmentStatusList() {
  return request({
    url: `${adminUrl}dict/type/qms_inspection_result_status`,
    method: "get",
  });
}
// 查询质检状态列表
export function getQualityInspectionStatusList() {
  return request({
    url: `${adminUrl}dict/type/wms_inspection_assignment_result`,
    method: "get",
  });
}
// 查询是否下推 0未下推 1已下推列表
export function getDownStatusList() {
  return request({
    url: `${adminUrl}dict/type/wms_receive_down_status`,
    method: "get",
  });
}

// ERP状态 00未处理 10保存成功 11保存失败 20提交成功 21提交失败 30审核成功 31审核失败 40下推成功 41下推失败
export function getErpStatusList() {
  return request({
    url: `${adminUrl}dict/type/wms_erp_status`,
    method: "get",
  });
}



//查询物料列表
export function getCommonSupplier(params = {}) {
  return request({
    url: `${adminUrl}commonSupplier/list`,
    method: "get",
    params,
  });
}

// 查询单位列表
export function getUnitList() {
  return request({
    url: `${adminUrl}dict/type/units`,
    method: "get",
  });
}

//查询物料列表
export function getGoodsList(params = {}) {
  return request({
    url: `${adminUrl}baseGoods`,
    method: 'get',
    params,
  });
}

// 查询物料类型 数据字典：成品、半成品、原材料列表
export function getGoodsTypeKeyList() {
  return request({
    url: `${adminUrl}dict/type/material_type`,
    method: 'get',
  });
}
